package edu.ubb.scrumster.model.model;

import java.util.List;

public class Project implements AbstractModel{
	int id;
	String name;
	User owner;
	String description;
	byte[] specification;
	String status;
	List<UserStory> userStories;
	List<Scrum> scrums;

	public Project(String name, User owner, String description,
			byte[] specification, String status) {
		super();
		this.name = name;
		this.owner = owner;
		this.description = description;
		this.specification = specification;
		this.status = status;
	}

	public Project(int id, String name, User owner, String description,
			byte[] specification, String status) {
		super();
		this.id = id;
		this.name = name;
		this.owner = owner;
		this.description = description;
		this.specification = specification;
		this.status = status;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public User getOwner() {
		return owner;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public byte[] getSpecification() {
		return specification;
	}

	public void setSpecification(byte[] specification) {
		this.specification = specification;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public List<UserStory> getUserStories() {
		return userStories;
	}

	public void setUserStories(List<UserStory> userStories) {
		this.userStories = userStories;
	}

	public List<Scrum> getScrums() {
		return scrums;
	}

	public void setScrums(List<Scrum> scrums) {
		this.scrums = scrums;
	}
	
	public String getObjectType(){
		return "Project";
	}

	public void validate() throws ModelException{
		if (this.description.equals("") || this.description.isEmpty()){
			throw new ModelException("The description is empty");
		}
		if (this.name.equals("") || this.name.isEmpty()){
			throw new ModelException("The name is empty");
		}
	}
	
}
